/*
package com.learning;

import com.learning.pojo.result.WordsAnalysResult;
import com.learning.pojo.result.WordsParam;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
import org.apdplat.word.WordSegmenter;
import org.apdplat.word.lucene.ChineseWordAnalyzer;
import org.apdplat.word.segmentation.Word;
import org.apdplat.word.tagging.PartOfSpeechTagging;

import java.io.IOException;
import java.util.List;

*/
/**
 * @author jukg
 * @date 2023/06/08 15:19
 * @description
 *//*

public interface WordService {

    List<WordsAnalysResult> analys(String text);


    void addWords(List<WordsParam> words);

    void removeWord();

    public static void main(String[] args) throws IOException {
        String text = "1234元户，北京市2023年10月1号18点2023-08-11 12:00:00北京市朝阳区光明小区上门处理事件88人8辆车";
        List<Word> list = WordSegmenter.seg(text);
        System.out.println(list);
        PartOfSpeechTagging.process(list);
        System.out.println(list);
        */
/*Analyzer analyzer = new ChineseWordAnalyzer();

        TokenStream tokenStream = analyzer.tokenStream("text", text);
//准备消费
        tokenStream.reset();
//开始消费
        while(tokenStream.incrementToken()){
            //词
            CharTermAttribute charTermAttribute = tokenStream.getAttribute(CharTermAttribute.class);
            //词在文本中的起始位置
            OffsetAttribute offsetAttribute = tokenStream.getAttribute(OffsetAttribute.class);
            //第几个词
            PositionIncrementAttribute positionIncrementAttribute = tokenStream.getAttribute(PositionIncrementAttribute.class);

            System.out.println(charTermAttribute.toString()+" ("+offsetAttribute.startOffset()+" - "+offsetAttribute.endOffset()+") "+positionIncrementAttribute.getPositionIncrement());
        }
//消费完毕
        tokenStream.close();*//*

    }
}
*/
